import Main from '@@/main/main'

export default [
  {
    path: '/',
    component: Main,
    meta: {
      title: '首页',
    },
    children:[
      {
        name:'home',
        component: () => import('@/view/main/index'),
        path: '/'
      }
    ]
  },
  {
    path: '/service',
    component: Main,
    meta: {
      title: '客服大厅',
    },
    children:[
      {
        name:'service',
        component: () => import('@/view/service/index'),
        path: '/service'
      }
    ]
  },
  {
    path: '/ticket',
    component: Main,
    meta: {
      title: '工单模块',
    },
    redirect: '/ticket/all',
    children:[
      {
        name:'ticket-all',
        meta: {
          title: '全部工单'
        },
        component: () => import('@/view/ticket/all'),
        path: '/ticket/all'
      },
      {
        meta: {
          title: '组内工单'
        },
        name:'ticket-waiting',
        component: () => import('@/view/ticket/dept'),
        path: '/ticket/waiting'
      },
      {
        meta: {
          title: '我的工单'
        },
        name:'ticket-running',
        component: () => import('@/view/ticket/running'),
        path: '/ticket/running'
      },
      {
        meta: {
          title: '已关闭工单'
        },
        name:'ticket-closed',
        component: () => import('@/view/ticket/closed'),
        path: '/ticket/closed'
      }
    ]
  },
  {
    path: '/ticket-detail',
    component: Main,
    meta: {
      title: '工单模块',
    },
    children: [
      {
        meta: {
          title: '编辑工单'
        },
        name:'ticket-edit',
        component: () => import('@/view/ticket/components/ticket-edit'),
        path: '/ticket-edit'
      },
      {
        meta: {
          title: '查看工单'
        },
        name:'ticket-view',
        component: () => import('@/view/ticket/components/ticket-view'),
        path: '/ticket-view'
      }
    ]
  },
  {
    path: '/people',
    component: Main,
    meta: {
      title: '人员模块',
    },
    redirect: '/people/employee',
    children:[
      {
        name: 'people',
        meta: {
          title: '员工',
        },
        path: '/people/employee',
        redirect: '/people/employee/all',
      },
      {
        name: 'people-list',
        meta: {
          title: '员工列表',
          hideInMenu: true,
        },
        path: '/people/employee/all',
        component: () => import('@/view/people/people'),
      },
      {
        name: 'people-join-list',
        meta: {
          title: '申请列表',
          hideInMenu:true
        },
        component: () => import('@/view/people/people-join-list'),
        path: '/people/employee/join-list',
      },
      {
        name:'people-dept',
        meta: {
          title: '分组',
        },
        component: () => import('@/view/people/dept'),
        path: '/people/dept'
      },
      // {
      //   name:'people-role',
      //   meta: {
      //     title: '角色',
      //   },
      //   component: () => import('@/view/people/role'),
      //   path: '/people/role'
      // }
    ]
  },
  {
    path: '/form',
    component: Main,
    meta: {
      title: '表单模块',
    },
    children:[
      {
        name:'form',
        component: () => import('@/view/form/index'),
        path: '/form'
      }
    ]
  },
  {
    path: '/setting',
    component: Main,
    redirect: '/setting/user',
    meta: {
      title: '设置模块',
    },
    children:[
      {
        name:'setting-user',
        meta: {
          title: '用户信息',
        },
        component: () => import('@/view/setting/user'),
        path: '/setting/user'
      },
      {
        name:'setting-tenant',
        meta: {
          title: '企业信息',
        },
        component: () => import('@/view/setting/tenant'),
        path: '/setting/tenant'
      }
    ]
  },
  {
    path: '/knowledge',
    component: Main,
    meta: {
      title: '知识库',
    },
    redirect: '/knowledge/all',
    children:[
      {
        meta: {
          title: '问题库',
        },
        name:'knowledge-all',
        path: '/knowledge/all',
        component: () => import('@/view/knowledge/index')
      }
    ]
  },
  {
    path: '/customer',
    component: Main,
    redirect: '/customer/all',
    children:[
      {
        meta: {
          title: '全部联系人',
        },
        name:'customer-all',
        path: '/customer/all',
        component: () => import('@/view/customer/all')
      },
      {
        meta: {
          title: '关注的联系人',
        },
        name:'customer-follow',
        path: '/customer/follow',
        component: () => import('@/view/customer/follow')
      },
    ]
  },
  {
    path: '/signin',
    name: 'signin',
    component: () => import('@/view/user/signin'),
    meta: {
      title: '登录',
    }
  },
  {
    path: '/welcome',
    component: Main,
    children: [
      {
        path: '/welcome',
        name: 'welcome',
        component: () => import('@/view/welcome/index'),
        meta: {
          title: '欢迎您使用CloudDesk服务'
        }
      }
    ]
  },
  {
    path: '/signup',
    name: 'signup',
    component: () => import('@/view/user/signup'),
    meta: {
      title: '注册',
    }
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
